<?php
class Application_Model_DbTable_Cart extends Application_Model_DbTable_DomainObject{
	
	protected $_name = 'uuch_cart';
	
	public function getMapper(){
		return array('CartId'=>'cartId',
				'UserId'=>'userId',
				'Id'=>'id',
				'DateCreated'=>'dateCreated');
	}
	
	/**
	 * 根据CartID返回Cart对象
	 * @param string $cartId
	 * @return Application_Model_Cart
	 */
	public function getByCartId($cartId){
		return $this->queryOne(array('cartId'=>$cartId));		
	}
	
	/**
	 * 根据UserID返回Cart对象
	 * @param int $userId
	 * @return Application_Model_Cart
	 */
	public function getByUserId($userId){
		return $this->queryOne(array('userId'=>$userId));
	}	

}